package app.cn.com.school.activity

import android.content.ContentValues
import android.os.Bundle
import android.view.View
import app.cn.com.school.R
import app.cn.com.school.adapter.UsedCountAdapter
import app.cn.com.school.databinding.ActivityIntegralBinding

/**
 * 所有的列表
 * */
class IntegralActivity : BaseActivity<ActivityIntegralBinding>() {
    override fun initBindingVar() {
    }

    override fun initTitle() {
        binding.titlebar.back.setOnClickListener { finish() }
    }

    var adapterCount: UsedCountAdapter? = null
    var moreList = ArrayList<ContentValues>()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        initBinding(R.layout.activity_integral)
        initView()
    }


    /**
     * 退款退货----积分显示
     * */
    private fun initView() {
        var type = this.intent.getStringExtra("type").toInt()
        when (type) {
            0 -> {
                binding.titlebar.title.text = "退款、退货"
                binding.linScore.visibility = View.GONE
                binding.linTypeIntegral.visibility = View.GONE
            }
            1 -> {
                binding.titlebar.title.text = "我的积分"
            }
            2 -> {
                binding.titlebar.title.text = "我的二手"
                binding.linScore.visibility = View.GONE
                binding.linTypeIntegral.visibility = View.GONE
            }
            3 -> {
                binding.titlebar.title.text = "我的评选"
                binding.linScore.visibility = View.GONE
                binding.linTypeIntegral.visibility = View.GONE
            }
            4 -> {
                binding.titlebar.title.text = "手机---"
                moreList.add(ContentValues())
                moreList.add(ContentValues())
                moreList.add(ContentValues())
                moreList.add(ContentValues())
                moreList.add(ContentValues())
                moreList.add(ContentValues())
                moreList.add(ContentValues())
                moreList.add(ContentValues())
//                if (adapterCount == null) {
//                    adapterCount = UsedCountAdapter(context, moreList)
//                    binding.usedContent.adapter = adapterCount
//                }
            }
        }
    }

}
